home *** CD-ROM | disk | FTP | other *** search
/ L' Effet Pommier 3 / L'Effet Pommier - Volume 03.iso / Programmation / Gooey1.3.1 / C Templates / Alert.c next >
Text File  |  1994-04-12  |  5KB  |  182 lines

  1. $$Loop Alerts
  2. $$Message User Alert, u:$Worksheet.name$.h
  3.  
  4. $$File u:$Worksheet.name$.h
  5. /*  $Worksheet.name$                                 Handle this alert */
  6. /*  $CopyRight$ */
  7.  
  8. /*    File name:  $Worksheet.name$.h
  9.     Function:  Handle this alert.
  10. $$if Alert.Stop
  11.     This is a STOP alert, it is used to inform the user that data is about to be lost.
  12.     It is also used for fatal type errors and tells the user about the error.
  13. $$endif
  14. $$if Alert.Note
  15.     This is a NOTE alert, it is used to inform the user of some general information.
  16.     This alert is not used if there is a possibility of losing any data.
  17. $$endif
  18. $$if Alert.Caution
  19.     This is a CAUTION alert, it is used to inform the user that if the current path
  20.     is taken then data may be lost.  The user can change the present course and
  21.     save the data.  This is the type of alert used to tell the user that he needs to
  22.     save the data before going on.
  23. $$endif
  24.  
  25.     This alert is called when:
  26.  
  27.     The choices in this alert allow for:
  28.  
  29.     History: $Date$ Original by $Author$
  30.  
  31. */
  32.  
  33. /* ======================================================= */
  34.  
  35. /* This routine is called at program startup to allow setting of any special */
  36. /*  items for the alert */
  37. void A_Init_$Worksheet.name$(void);
  38.  
  39. /* This routine is called while inside of the Alert filter */
  40. /*        theDialog is the dialog(alert) pointer */
  41. /*        theEvent is the event that we are to see if we should filter */
  42. /*        itemHit is the item we set if we handle the event ourselves */
  43. Boolean Filter_$Worksheet.name$(DialogPtr theDialog, EventRecord *theEvent, short *itemHit);
  44.  
  45. /* This routine is called after the alert has been responded to */
  46. /* itemHit is the item that was selected */
  47. void A_Hit_$Worksheet.name$(short itemHit);
  48.  
  49. /* ======================================================= */
  50.  
  51. $$CloseFile
  52. $$Message User Alert, u:$Worksheet.name$.c
  53.  
  54. $$File u:$Worksheet.name$.c
  55. /*  $Worksheet.name$                                 Handle this alert */
  56. /*  $CopyRight$ */
  57.  
  58. /*    File name:  $Worksheet.name$.c
  59.     Function:  Handle this alert.
  60. $$if Alert.Stop
  61.     This is a STOP alert, it is used to inform the user that data is about to be lost.
  62.     It is also used for fatal type errors and tells the user about the error.
  63. $$endif
  64. $$if Alert.Note
  65.     This is a NOTE alert, it is used to inform the user of some general information.
  66.     This alert is not used if there is a possibility of losing any data.
  67. $$endif
  68. $$if Alert.Caution
  69.     This is a CAUTION alert, it is used to inform the user that if the current path
  70.     is taken then data may be lost.  The user can change the present course and
  71.     save the data.  This is the type of alert used to tell the user that he needs to
  72.     save the data before going on.
  73. $$endif
  74.  
  75.     This alert is called when:
  76.  
  77.     The choices in this alert allow for:
  78.         
  79.     History: $Date$ Original by $Author$
  80.  
  81. */
  82.  
  83. #include "mmCommon$Prototype.name$.h"    /* Common */
  84. #include "Common$Prototype.name$.h"        /* Common */
  85.  
  86. #include "$Worksheet.name$.h"                /* This file */
  87.  
  88. #pragma segment Alerts
  89.  
  90. /* ======================================================= */
  91.  
  92. /* Routine: A_Init_$Worksheet.name$ */
  93. /* Purpose: This routine is called at program startup to allow setting of any special */
  94. /* items for the alert */
  95.  
  96. void A_Init_$Worksheet.name$(void)
  97. {
  98. }
  99.  
  100. /* ======================================================= */
  101.  
  102. /* Routine: Filter_Caution_alert */
  103. /* Purpose: This routine is called while inside of the Alert filter */
  104.  
  105. Boolean Filter_$Worksheet.name$(DialogPtr theDialog, EventRecord *theEvent,short *itemHit)
  106. {
  107. Boolean the_Filter_$Worksheet.name$;
  108.  
  109. the_Filter_$Worksheet.name$ = FALSE;                    /* Let the Alert routine handle it */
  110.  
  111. return(the_Filter_$Worksheet.name$);                    /* return the result */
  112. }
  113.  
  114. /* ======================================================= */
  115.  
  116. /* Routine: A_Hit_$Worksheet.name$ */
  117. /* Purpose: This routine is called after the alert has been responded to */
  118. /* itemHit is the item that was selected */
  119.  
  120. void A_Hit_$Worksheet.name$(short itemHit)
  121. {
  122.  
  123.  
  124.  
  125.     $$Loop Control.type = Button
  126.     $$if Control.Default
  127. /* This is the default selection, when RETURN is pressed. */
  128.     $$endif Control.Default
  129. if (ResA_$Control.name$ == itemHit)                /* $Control.FullName$,See if this control was selected */
  130.     {
  131.     }
  132.  
  133.     $$EndLoop Control.type
  134.     $$Loop Control.type = Icon
  135.     $$if Control.NonGraphic
  136. if (ResA_$Control.name$ == itemHit)                /* $Control.FullName$,See if this control was selected */
  137.     {
  138.     }
  139.  
  140.     $$endif Control.NonGraphic
  141.     $$EndLoop
  142.     $$Loop Control.type = Picture
  143.     $$if Control.NonGraphic
  144. if (ResA_$Control.name$ == itemHit)                /* $Control.FullName$,See if this control was selected */
  145.     {
  146.     }
  147.  
  148.     $$endif
  149.     $$EndLoop
  150.     $$Loop Control.type = UButton
  151. if (ResA_$Control.name$ == itemHit)                /* $Control.FullName$,See if this control was selected */
  152.     {
  153.     }
  154.  
  155.     $$EndLoop
  156.     $$Loop Control.type = HotRect
  157.     $$if Control.HotSpot
  158. if (ResA_$Control.name$ == itemHit)                /* $Control.FullName$,See if this control was selected */
  159.     {
  160.     }
  161.  
  162.     $$endif Control.HotSpot
  163.     $$EndLoop
  164.     $$Loop Control.type = Sicn
  165.     $$if Control.NonGraphic
  166. if (ResA_$Control.name$ == itemHit)                /* $Control.FullName$,See if this control was selected */
  167.     {
  168.     }
  169.  
  170.     $$endif Control.NonGraphic
  171.     $$EndLoop
  172.  
  173. }
  174.  
  175. /* ======================================================= */
  176. /* ======================================================= */
  177.  
  178. $$CloseFile
  179. $$EndLoop
  180.  
  181.  
  182.